package com.example.demo;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;


import javax.servlet.http.HttpServletRequest;

@Controller
public class indexController {

    @GetMapping("/login2")
    public String Login(HttpServletRequest request){
        if (request.getSession().getAttribute("username") != null){
            System.out.println(request.getSession().getAttribute("username"));
            System.out.println(request.getSession().getAttribute("password"));
        }
        String username=request.getParameter("username");
        String password=request.getParameter("password");
        request.getSession().setAttribute("username",username);
        request.getSession().setAttribute("password",password);
        System.out.println(username);
        System.out.println(password);
        return "hello";
    }






}

